<template>
  <div>
    <el-menu
      :default-active="menuName"
      :router="router"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      :unique-opened="opend"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-tickets"></i>
          <span>文章</span>
        </template>
          <el-menu-item index="/admin">发布</el-menu-item>
          <el-menu-item index="/admin/news">列表</el-menu-item>
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>专题</span>
        </template>
          <el-menu-item index="/admin/project">列表</el-menu-item>
      </el-submenu>
      <el-submenu index="3">
        <template slot="title">
          <i class="el-icon-star-on"></i>
          <span>标签</span>
        </template>
          <el-menu-item index="/admin/type">列表</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
export default {
  props: {
    menuName: {
      type: String,
      default: '/admin'
    }
  },
  data () {
    return {
      opend: true,
      router: true
    }
  }
}
</script>

<style lang="stylus">
  .el-menu-vertical-demo
    height 100%
    min-height 800px
</style>
